#!/usr/local/bin/gnuplot -persist
set terminal pdfcairo enhanced font "Arial,10" fontscale 1.0 size 600, 400
set output "output.pdf"

set dummy u, v
set key bmargin center horizontal Right noreverse enhanced autotitle nobox
set parametric
set view 50, 30, 1, 1
set isosamples 50, 20
set hidden3d back offset 1 trianglepattern 3 undefined 1 altdiagonal bentover
set style data lines
set xyplane relative 0
set title "ellipsoid" 
set urange [ -3.14159 : 3.14159 ] noreverse nowriteback
set vrange [ -3.14159 : 3.14159 ] noreverse nowriteback
set xrange [ * : * ] noreverse writeback
set x2range [ * : * ] noreverse writeback
set yrange [ * : * ] noreverse writeback
set y2range [ * : * ] noreverse writeback
set zrange [ * : * ] noreverse writeback
set cbrange [ * : * ] noreverse writeback
set rrange [ * : * ] noreverse writeback
set colorbox vertical origin screen 0.9, 0.2 size screen 0.05, 0.6 front  noinvert bdefault
NO_ANIMATION = 1

dimension_file = "dimension"
a = 0
b = 0
c = 0
file_exists(file) = (system(sprintf("[ -f %s ] && echo 1 || echo 0", file)) == "1")
if (file_exists(dimension_file)) {
    values = system(sprintf("cat %s", dimension_file))
    a = word(values, 1)
    b = word(values, 2)
    c = word(values, 3)
}

splot (a*sin(u)*cos(v)),(b*sin(u)*sin(v)),(c*cos(u)) with lines